package com.neuedu.dao.impl;

import com.neuedu.dao.UserDao;
import com.neuedu.model.User;
import com.neuedu.utils.DbUtil;

import java.util.List;

/**
 * @author 许中
 * @date 2024-09-06 11:01:12
 */
public class UserDaoImpl implements UserDao {
    @Override
    public User selectUserByUnameAndPwd(String username,String password) {
        List<User> list = DbUtil.select(User.class, "username=? and password=?", username, password);
        if(list!=null&&list.size()>0){
            return list.get(0);
        }
        return null;
    }

    @Override
    public List<User> selectAll() {
        return DbUtil.select(User.class);
    }
}
